<?php
namespace app\admin\model;

use think\Model;

class User extends Model {
    /**
     * @param string $field
     * @param $condition
     * @return array|false|\PDOStatement|string|Model
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function getOne($condition,$field = '*'){
        return $this->name('user')->field($field)->where($condition)->find();
    }

    public function edit($condition,$data){
        return $this->name('user')->where($condition)->update($data);
    }
}